package com.scapegoat.pay.account.service.api.impl;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.scapegoat.pay.common.core.page.PageBean;
import com.scapegoat.pay.common.core.page.PageParam;
import com.scapegoat.pay.account.service.api.RpAccountService;
import com.scapegoat.pay.account.service.dao.RpAccountDao;
import com.scapegoat.pay.account.service.entity.RpAccount;

/**
 * 账户service实现类
 *
 * @author walkman
 * @date 2017年10月17日 21:20:03
 */
@Service("rpAccountService")
public class RpAccountServiceImpl implements RpAccountService {

    @Autowired
    private RpAccountDao rpAccountDao;

    @Override
    public void saveData(RpAccount rpAccount) {
        rpAccountDao.insert(rpAccount);
    }

    @Override
    public void updateData(RpAccount rpAccount) {
        rpAccountDao.update(rpAccount);
    }

    @Override
    public RpAccount getDataById(String id) {
        return rpAccountDao.getById(id);
    }

    @Override
    public PageBean listPage(PageParam pageParam, RpAccount rpAccount) {
        Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("accountNo", rpAccount.getAccountNo());
        return rpAccountDao.listPage(pageParam, paramMap);
    }
}